#include <stdio.h>
#include <stdlib.h>
#include "list.h"

/* a simple use of the list files */

int main() {
  /* create a simple list */
  struct node *list = emptyList();
  list = add("a", list);
  list = add("b", list);
  list = add("c", list);
  list = add("d", list);

  /* access elements of the list one by one and display them */
  while(list != NULL) {
    char *str = first(list);
    list = rest(list);
    printf("%s\n", str);
  }

  return 0;
}
